package api

import (
	"2-11zy/api/handlers"
	"2-11zy/api/middleware"
	"github.com/gin-gonic/gin"
	jwt "github.com/golangblogs/gojwt"
)

func LoadRouter(r *gin.Engine) {
	r.Use(middleware.DoeM())
	user := r.Group("/user")
	{
		user.POST("/upload", handlers.Upload)
		user.POST("/addarticle", handlers.AddArticle)
		user.POST("/login", handlers.Login)
		user.Use(jwt.JWTAuth("2209a"))
		user.POST("/addfollow", handlers.AddFollow)
		user.GET("/chat", handlers.Chat)
		user.POST("addRoom", handlers.AddRoom)
		user.POST("adduserrooms", handlers.AddUserRooms)

	}
}
